package com.vulb.network.http;

import java.util.HashMap;

import com.google.gson.Gson;
import com.vulb.protocal.http.Response;

public class VulbHttp {
	
	public static String url = "http://test.komugi-office.com:8080/knowledge/web/login_normal";
    public static Response post(String url, HashMap<String, Object> params) {
        Response response;
        
        SyncPost httpPost = SyncPost.create();
        try 
        {
            Gson gson = new Gson();
            
            String strParams = "";
            if (params != null)
            {
                strParams = gson.toJson(params);
            }    
            String json = httpPost.postJson(url,strParams);
            response = Response.parse(json);
        } catch (Exception e) 
        {
            e.printStackTrace();
            response = Response.build(Response.HTTP_ERROR, "");
        }
        
        return response;
    }
}